package com.wish.g01.base.dto;

public enum CheckBatchType {

	EIGHT("8点半的代付和快捷", 1),
    ELEVEN("11点的微信和支付宝", 2),
    SD("手动重新对账", 3);

    private String name;
    private int index;

    private CheckBatchType(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (CheckBatchType c : CheckBatchType.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public static Integer getIndex(String name) {
        for (CheckBatchType c : CheckBatchType.values()) {
            if (c.getName().equals(name)) {
                return c.getIndex();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
